# -*- coding: utf-8 -*-



def update_media_urls(item, media_urls):
    """更新媒体URLs"""
    if media_urls.get('images'):
        item['images'].extend(media_urls['images'])
    if media_urls.get('videos'):
        item['videos'].extend(media_urls['videos'])
    if media_urls.get('audios'):
        item['audios'].extend(media_urls['audios'])
    if media_urls.get('main_files'):
        # 直接添加字典列表
        item['main_files'].extend(media_urls['main_files'])
    if media_urls.get('attachment_files'):
        # 直接添加字典列表
        item['attachment_files'].extend(media_urls['attachment_files'])

def get_iaff_headers():
    """获取IAFF网站专用的请求头"""
    return {
        'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',
        'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
        'Accept-Language': 'en-US,en;q=0.9',
        'Accept-Encoding': 'gzip, deflate, br',
        'Connection': 'keep-alive',
        'Upgrade-Insecure-Requests': '1',
        'Sec-Fetch-Dest': 'document',
        'Sec-Fetch-Mode': 'navigate',
        'Sec-Fetch-Site': 'none',
        'Sec-Fetch-User': '?1',
        'Cache-Control': 'max-age=0',
        'DNT': '1',
    }